package com.ftg.shopping.sp_roleinfo.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ftg.shopping.sp_roleinfo.entity.SpRoleinfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface RoleMapper  extends BaseMapper<SpRoleinfo> {

    @Select("SELECT distinct a.privilegeId,a.privilegeName,a.linkUrl from sp_privilegeinfo a LEFT  JOIN sp_roleprivilege_mid b ON a.privilegeId = b.privilegeId WHERE b.roleId = #{roleId}")
    List<Map<String,Object>> quanxian(int roleId);

    @Select("select privilegeId id,privilegeName title,parentId FROM sp_privilegeinfo")
    List<Map<String,Object>> quanxianall();


}
